const { shell, ipcRenderer } = require("electron");
const path = require("path");

window.addEventListener("DOMContentLoaded", () => {
  urlBtn.addEventListener("click", () => {
    shell.openExternal("https://cn.bing.com/");
  });

  folderBtn.addEventListener("click", () => {
    shell.showItemInFolder(path.resolve(__dirname));
  });

  ipcRenderer.on("openUrl", () => {
    iframe.src = "https://cn.bing.com/search?q=%E7%99%BE%E5%BA%A6";
  });
});